fix error when receive incomplete data