Data iterator not working