Remove unneeded threads and fix closing issue
Button not working