Trying to fix pesky error with recursive calls