fix nontermination error