update the whole structure and add sync