Make sure to create the prefs directory if it doesn't exist