solve quit/connection close race