fix bug when both label and format is specified