register and logout start