Code changes to add admin check