added managelogin to handle login