clear buffer before using, every time