Fixed fd leak