Filter out duplicate resource ids when connecting with a tag name