Fix lambda connection, pass by value

Fixes crash