change login function to set_user