logic fix for list and map query search