Fixed if-redirect issue.