update with login function