Made some changes to login functionality