Update MainEngine.php