Use in statement instead of has_key.