Added unit test for error