set buffers correctly