implemented logout and register