fixed data loader to ensure that headers are built and verified *before* any database modifications are made