updated script for ip address resolving