added range threshold