implemented logout functionality