added a function to admin.php