Added method that saves user preferences