updated query