added study id validation to comparison