fix js scope