fixed redirect stack error