implemented custom validation functionality