= means you are assigning it the value of 1

== means you checking the equality to 1

sounds like a path/scope issue.. like the var isnt getting set or checked correctly..