fix recursion error