Updated sync.js