Works on logout functionality