add process termination script when encounter error