bugfix when calcuating core table sync order