fixing typo in redirect logic