updated redirect logic