make error reporting more accurate