added valid_mac_or_id function