bug fixes in index.php, register working fine