improved error reporting