Clean up and added progress dialog