write to file instantly when reducing
clean all the tmp directories