solve bug with same buffer size