fixed mda_set to work directly and create keys as it goes