Changed method of creating temporary files