added logged in and logged out feature