fix measurement interval logic