adding promises and renaming logIn to login