Updating the sync logic in HashTree