range object support and bug fix