Added some error handling, and notifications