Added sync function