logout feature, some corrections