implement custom validation