fix the error in generating temp folder