update buffer