Exception thrown

Serialization of 'Closure' is not allowed