Fix error when trying to login again after logging out