Got the preferences save functionality working