Fixed bug on authentication failure