tweaking auto_scaling handler to be more resilient.