fix catching polymorphic types by value