add related query function