horrible loop fix