better error handling and success reporting