improved error handling and notification