patch: use run_command instead of direct subprocess