use availablePorts as static method