fixed block after closing a socket