Fixes #3 Finally threads are closing!, still have some problems with double threads.