add msleep into a routine of killing processes.