updated query writers fn