There is a little confusion about gates
inputs, I am trying to clarify this issue.
Always connect input to gates to either
low or high, never leave inputs floating
or disconnected, it is a good practice to either pull the inputs lo or high by means of a resistor as shown, cmos gates are specially picky about their input status. I hope this helps.