use TryGetValue instead of ContainsKey