Error handling and success message