all threads are stopped before app is closed