bug fix at db connection