Add remove elements

remove all elements in buffer, fix size error