Modified db connection