changed/improved  user login method