ensuring range indices are numbers