fixed bug with redirects