Fixed notice bug in main.php as well