Rewrite the IP address recording code