canvas is created correctly

added check for domElem