add getrange and fix some bugs