Changed the handling of user login