move destructor to onSetMod