Queries fix for q3 and q9