improved router IP finding function