modification to login code