added missing semicolons
handled case where user navigates to search result on the current page