validation for users creation and editing