added validation check to minimize necessary customization