cleanup threading
create a checkbox for background threading