improved logout layout and logic