fix bug when view is in the URL