fix offline sync problem