added redirect condition