bug fixing for index.php