replace mode.set with native dict