added logout functionality and return to login from register