fixed bug with js