change ajax calling to a recursive method and prevent caching