Fix error on logout