fix db join query exception