Add onPreferencesLoaded event