Avoid sometimes infinite loop