Principal G-bundles on nodal curves