Fix the bugs in bootstrap function with data validation