Fix  bug with redirects