start to support range mode, but not finished yet