Removed anonymous function

Fix for #795