fixed up the check for missing values function that prepares the data for the stack layout