trial query logic works fine