fragment and query in the right order