Fix haskey deprecation warning