Added check for valid first hop ip address