fixed minor bug in inRange