Exit case for otherwise infinite loop