Fixed creating a temporary file