ends infinte loop