fix issue with null values coming out of group by queries