ajax counter on document ready fix