add buffer monitor func.