fixed some syncing logic