Updated IP address logic