fixing error reporting