Fixed preferences.js callback issue