debugging sync function