adding redirect condition