fix destructor order

save before rules (allow for unloading of data)