Make the console auto closeable