fixed sync and database