changed variant into polymorphic variant