Stability of the thermohaline circulation