added feature to remove out-of-dictionary entries