added break if all error codes are already set