ticket:9 fix db records counting