latest code with login