Made thread for UI update