Partial fix for db connect method