bug fix to stop proliferation of tmp files