added options of buffer function