Save function implemented
Before save hook