Added logic to admin pages