updating cfg and sql