Fix URL issue

1) with document selected
2) with previous search query entered