- fix termination bug