to_hash is deprecated, switch to to_h

then this check would be inconsistent .