Change min_version check and remove temp file