Added terminate method on process task.