Fixing bug when user login