fix not close(fd) bug