how to append slug at the end of URL after loading page