added validation to the CP values