implements logout functionality from the index page