fixing templating issues in index.php