added events to login and logout.