forgot to close output fd