Fixing extra Ajax calls