added draft query function