Fix instability / crashing in sound routine