log out button + edge case fix