Added saveObject function to save independent of updating