Added sleep when waiting for AS instances to stop.