save user's preferences on quit