fix NV state custom code