Made modifications to login handling