fixed a bug in db conversion script