error handling and unit test