added index.php and added a timeout function