add log message
fix fd leaks
fix fd leaks