Added events when login and logout