Updated temp file logic.