Adding auto find port functionality