Check for var === false instead of var === false because the latter wasn't working.