Fix JS bug