Update for Error handling and Logging.

Update for Error handling and Logging.