trying to fix closure rewrite