fixed THE MOST ANNOYING BUG. I had two threads going at the same time, lost reference to one. I hate debugging now.