updating iterator and added fetchnext()