Changed code for logout.