modify the loop for checking changes