implemented login&logout