fixed recursion error on firefox