Unfortunately, `$attributes` is not defined until line 450 in your patched file