Sorted out multithreading syncronisation