JS bug fix