made logout a global variable so that it can be manipulated by a logout function