Changes to login logic