Fixed error with when sensor in range block