Added code for logout in viewers