filter endless loops