fix null pointer exception when no labels