fix up emfile issue with replacer