Changed listener to match and added randomized port detection