thread file generation works