pre-save validation