added syncing flag to prevent cascading ajax calls