Bug fixing for user auth