Changed getPreferences to return promise