write done the sync, but there are some bugs