Added some userlogin logic