Improve URL bar handling