added new clear the buffer function

added new clear the buffer function