add exception handling and stop the progress if problems are detected