Made close implementation for buffers