cleaned up code in login.php