Un-wrap functions using twice-called middleware