use test result for kill() to guard the code