Added logout function
Have to be logged in to view pages