wrap the addIndex method