fix total piece wrong type