Bug fix engine.js