fixing dom.js bugs