improved the buffer manager