ensure keys are compared correctly