working on sync logic