makine sure that the recursive method call always goes through by taking it out of the callback