Fixing to work with current ws version and support dynamic ports