Exception handling and Logging added#2