Prevent modal form from freezing when windows.location.url has hash parameter