add register and logout