fix connection close issue