added data preparation step to make sure all the variables are completed.