safer iterator access