add buffer for debug function