defined doLogin and modified admin