fixed a bug with 'document.height' and 'document.width' calls