fixed rare exception when setting hidden setting on shutdown