refactored userlogin and adduser