Attempting a JS bug fix