fixed closing closed socket