Add unit test for failure case