append label only when formatted is not undefined
Merge pull request #1733 from flyerhzm/append-label-only-when-formatted-defined

append label only when formatted is not undefined