fixed db connection settings and added proper discard on cancel