when to terminate the code