fix bug where server didn't get 'connection lost' message