Corrected checkadmin function