fix some bug on logout