fixing bug on logout