Adding additional search path to XHR requests, not to state url, removing unload event listener