MOSFET is not turning off when the gate terminal is grounded
If you attach A to ground, you have, in effect, this:







simulate this circuit &ndash; Schematic created using CircuitLab

Since the gate current of a MOSFET can be assumed to be zero, we can think of this as a voltage divider, and see that the voltage at the gate of M1 is 2.7V. This isn't low enough to turn the transistor off.

Probably, you want to remove R6, or make its value very much less. A MOSFET, unlike a BJT, has a very high gate impedance, and so does not require a resistor to limit the current.