remove unused var
fix leafing file descriptors