add run_when_killed