prevent hitting the stack size ceiling