better admin.php logic