Brought changes from ajax.php to index.php