change js to more right way