Minor bug fix on undeclared var