updated the iter version of exists