better handling of null data and no data