fix 2 query function