dunno why dict_index gets reset to 0