fixed error reporting bug (2)