add input and output buffer