add javascript closure