fix crash / order of (de)init