this commit solves a few iterator problems