add javascript, change index