Changed progress dialog to allow END to be called multiple times