adds sort and q to resource