fix fd close