fix another potential stack overflow