Fixed a bug in AuthenticationHandler