check for valid ip address