Prevented infinite loop wasting CPU