put db connection in a promise