Improved Exception Handling and Logging

Improved Exception Handling Logging