added error reporting lines to top