fix bug and add dictionary class