now closes the console when done with it (not sure if this is desirable)