Added better error handling
Added notification support for failures
Better error handling