fixed non graceful close of connection