finally got polymorphism in a map working