fix db passing when fail in clause