Fix undefined value as array reference error when no programmes found