reworked index.php for login procedure