Fixed b0rken redirect logic