Changed the scratch folder to be NSTemporaryDirectory() to avoid needing to manually clean up