need to add callback or some way to negate maximum stack overflow