Added progressdialog & cleanup