Fixed bug in AuthManager