Solved UI hanging with background threads