added memoization to user login