correct the invertedDic