fixed db result processing