filter null values out when calculating minimum value