diff --git a/main.go b/main.go
index 60625a0ac0d217816290c6decb11236960139342..29f18af306873278459d2dafce17099810a05048 100644
--- a/main.go
+++ b/main.go
@@ -136,7 +136,7 @@ func errorHandler(errorFilesPath string) func(http.ResponseWriter, *http.Request
 			if _, err := os.Stat(file); os.IsNotExist(err) {
 				scode := strconv.Itoa(code)
 				filePath = fmt.Sprintf("%v/%cxx%v", errorFilesPath, scode[0], ext)
-				if _, err := os.Stat(file); os.IsExist(err) {
+				if _, err := os.Stat(file); os.IsNotExist(err) {
 					continue
 				}
 			}