fixed a bug with logout