Fixed small query error