use to_hash for older ruby