fixed error reporting issue