Adding custom validation to menu items