update engine.js