add validation function and pre save function
unnecessary console log