fix bug where db connection not avail on listen