synch is now working with threads