fix connections to db