Added attribute to allow query function to be specified