initial save and delete functions updated