Fix preference not saved bug and add restore to default