fixed terminate condition