move mate to head.inc.php