Fixing broadcast script to handle response errors