check if IP address is valid