moved debug messaging to after db setting set