working on fixing error reporting