Fixed the crappy code in main.php