Fixed exceptions by replacing circular with recursive method call