fixed sync of db