making logout functionality