Ok,
When i run the code that calls the script from the command line, it works. I have tried your suggestion with no luck.
Finally i decided to run the second script code from the original script since i'm in the middle of a project and doesn't have time to keep on looking for a solution.

So, for now, thank you Glenn.