fixing problems with dictionary