Close buffers automatically