Added check for empty elections list