Use hookIndex for recording multiple restore exec hooks.
