recursion error fix