fix JS bug