more bug fix for range selection