Now there's a PIC solution if I ever saw one. Run a closed loop inside a closed loop to prevent the second one from running!