close all buffers func