test for error cases