fixed hilarious bug with infinite loops