Add progress dialog and add worker thread