replaces `has` with `haskey`