em seems to be breaking after 2 iterations