fixing bug wheredict keys were arbitrary but still represent same query