another js scope fix