fix upgrade for when there's no records