address mateiz's comment about the temp folder name problem. The implementation followed mateiz's advice.