fixed up error reporting