useful code for synch purposes