add length to buffer