fixed recursion error