tweaking sync.js