cleanup on halt in some modules