added new code for logout