fix recursion going too deep in recursion for no particular reason