Improved Exception handling