Fix depreccated function in preferences