Make path based queries more safe