Fixed validation issues in index.php