Deal with missing values in db