add javascript and test