bug fix in measurement