fix ambient mode crash