add login validation in head.php