fixed "Serialization of Closure not allowed" + test