test for error handling