fixed the engine destructor