Fix query not being applied from stored link