bug fix in the dictionary generation code