Weird error with threads. need to test