Fixed dynamic db con refactor