add polymorphic hash functor