adding port detection