js scope update