stop algorithm if it gets out of control