closes the loop