added validation to select elements