support passing option for buffer