fixed invalid error reporting