fixed some minor bugs for the preferences