add logout event handler