Trying to turn off an output 1second after a switch is tripped

Wait, sorry, I found it

if(latch = true)

should be

if(latch == true)

now it's working