Added method to load pref into attribute and do callback