by Mohammed Essaid MEZERREG.
Strangely, it's working now, without me changing anything to either the code or the configuration, I added the get user by field but I deleted it immediately when I find that the other function start working , perhaps moodle as a soul or may be the server was giving the function a little time to execute, I think it needs more investigations.