fix bug on logout