allow setting lastIndex