Fixing query segment for empty routes