trying to fix JS bug