exit loop when in external control