Changed thread into asynctask