add check for valid ip addresses