fixed error reporting