fixed mistake in select_ip