Modified the logic for the login