fixed inRange bug