fix so functions don't waste time writing in intermediate files