Fixing second login function