added logout functionality and conditional navbar based on login status