Corrected runtime error in editpreferences