iterator end condition should be !=