Why even bother setting this above if you're going to unset it later? Do you get an undefined error or something? I haven't dug in to the code context too much, but can you just check params at the original assignment point?