fixes #1148 use to_hash instead of to_h

Since some users don't have the versions needed for to_h  (see #1148)