Modified process kill logic.