raw save function partially updated but still not working