fix bug around muliple types in same buffer