add register and login function