Fix logic login logout error