fix bug of buffer assert, erase can accept any value