Set the redirect only if it is an actual redirect. Still there's some issues :s