adds logout functionality