fix fd leakage