stop after 1000 iterations