fixed sync adapter code