fix bugs and rename javascript