Fix javascript scoping issue.