fix faults because of shutdown order and referencing