fix bug in transformRange