updated to match chromes implementation