now detects highest used index properly after imports and address chain extention