changed matchGuid function to not fail on undefined ids