fix for bug 997416 return query not list

add test