index may be invalid.