Fixed Bug when removing all the preferences