Added code for cleaner log out. Trying to fix bug in newsfeed.