bugfix when synchronizing database.