added category to to_hash