Avoid possible crashes, use temporary file