Thank you Niclas, I was fighting with a similar problem for several days, and I didn't notice the condition for terminate function execution. With trap_exit = true, everything work as expected with my first (and simple) version... Best regards, Pascal.