Fixed JS bug