fix hang on connection close