Fix JS variable missing error