fix stack overflow.