fixed problem with ports and added some more trace features (dom)