retry and disconnect on logout