Modified the login procedure