some more muckery to get js in shape