Correction to processing order for setting up the database