Added support for early termination