tests
more robust error handling