Auto-sync function.