Replaced the global redirect function with redirect on the site