adding test for error