catch inf. loop