implementing sync