Main.php and template updated