fix bug in get_meas_from_sample method