fixed termination error