Added error messages and log out button
fixed 'log out' displaying while not logged