Added buffer management