fix termination