bug fix for when title is NULL in legend