removed the infinite loops