handle missing data properly