correted javascript