slight fix to layoutengine.js