@dhanya : this code can be simplified as follows:
<pre>
  for (UIViewController *controller in [self.navigationController viewControllers]){
    if ([controller isKindOfClass:[PacoFindExperimentsViewController class]] ||
        [controller isKindOfClass:[PacoPublicExperimentController class]]) {
      [self.navigationController popToViewController:controller animated:YES];
      return;
    }
  }

</pre>