Replaced lambda hook with named function