redundant code, move to security.php