added test for error handling