control loop

loop to stop infinite behavior