message should get logged and reset at every iteration of the loop