fix engine, make its core more robust