fix issue where redirect would trigger another redirect, so next would never get called