change js to auto-init