Progress dialog finally debugged and prepared