added dom stuff to constructor