check the received length.