The code was attempting to delete temporaryDirectory while it should have been deleting tempBundleDirectory