create the temp folder only if useFiledFromTemp is true, move below