few fixes, use updated query