check for valid ip