Added closing of threads, have to fix the join.
Restore