forgot to put the flag to close the first iteration!