bug in iteration fixed