added validation for selection