Updated the recursive count to 5000 from 5. Also avoid visiting the page if you are already there