bugfix for comparing keys