fix behaviour of DOM.query