[Temp]Porting the code for thread safe execution, so far no complications, all resolved