Evolution and termination of H-modes in NSTX