while attaching, record his Account ID to .@ type variable and after back to executor then you will have variable to let you use.
EDIT:
or record a variable when someone don't have item and move close to out of loop,
so loop will keep doing and add one if to do close if variable is true