fixed bug in sync_all