update buffer and process