Added scope in JavaScript