range condition fix