Can OPAMP unused pins left open?


Currently i am using AD8544 for a test circuit to prototype a latching circuit using an Op-Amp. Here is the circuit

I have wired as per above. 

Setup: When Vsense is above than Vref, o/p goes high and D2 gets forward biased and this becomes a closed loop so even when Vsense is removed the output is high(LED will glow). 

Problem statement:

1. When Vref is turned ON first and then Vsense and then Vcc, the circuit works properly and when Vsense is above Vref LED remains ON. working properly.

2. Back to OFF state, I turn ON Vcc first(Vsense and Vref is not turned ON yet) the LED continues to be ON ie O/p goes high. 

I am not clearly getting what is the problem. 

AD8544 is a quad opamp. I am using only 1 of them. others are left open. will this create such a scenario?

Please help me.

Thanks in advance.