ajax called for each page working