tidy up set db connection