Tested the auth fail case and fixed a bug related to it