add login function for admin