fix condition in #rules_to_hash