fix bug with missing data