fixed a bug in the logout