fixed the exception appearing when the engine is stopped