updated error handling and test failure