fix error in js