I come back with some new things.
It is not a problem of function/procedure. It is a problem of timers.
I will open a new post for this.