fixed label selection bug and output format