Fixed: memory leak did not delete temp file