Doctrine of necessity is alive: NA okays military courts