now it works with js