adding the login and logout functionality also improving the  register class