Db factory now correctly reutrns a db connection