Adding code to save the record