Medal: close() function to logout