added tests for error case