finished the login/logout funtionality