Created logout functionality