update code for login