Fixing a bug when redirecting urls.