fix bug when initializing dictionary