fix calc buffer pop count