fixed incorrect reference to $labels