fixed hasOpenPorts() to work properly with multi-input boxes