Minor tweak login function