add check for deleted accounts
refactoring to use fixIterator isntead of manually iterating