some updates to buffer management