change update method of preview.js